import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/view/Index'
import Desktop from '@/view/Desktop'
import Test1 from '@/view/test/Test1'
import Test2 from '@/view/test/Test2'
import Login from '@/view/Login'

import SysUserList from '@/view/sys/user/List'
import SysUserAdd from '@/view/sys/user/Add'
import SysUserEdit from '@/view/sys/user/Edit'
import SysUserMy from '@/view/sys/user/My'
import SysUserRoles from '@/view/sys/user/Roles'

import SysMenuList from '@/view/sys/menu/List.vue'
import SysMenuAdd from '@/view/sys/menu/Add.vue'
import SysMenuEdit from '@/view/sys/menu/Edit.vue'

import SysRoleList from '@/view/sys/role/List.vue'
import SysRoleAdd from '@/view/sys/role/Add.vue'
import SysRoleEdit from '@/view/sys/role/Edit.vue'
import SysRolePermission from '@/view/sys/role/Permission.vue'

import SysLoggList from '@/view/sys/logg/List.vue'

import FlsActivityList from '@/view/fls/activity/List.vue'
Vue.use(Router)

export default new Router({
    routes: [
        {path: '/', redirect: '/index'},
        {path: '/index', component: Index},
        {path: '/desktop', component: Desktop},
        {path: '/test1', component: Test1},
        {path: '/test2', component: Test2},
        {path: '/login', component: Login},
        {
            path: '/sys/user', component: SysUserList, children: [
                {path: 'add', component: SysUserAdd},
                {path: 'edit/:id', component: SysUserEdit},
                {path: 'roles/:id', component: SysUserRoles}
            ]
        },
        {path: '/sys/user/index', redirect: '/sys/user'},
        {path: '/sys/user/my/:id', component: SysUserMy},
        {
            path: '/sys/menu', component: SysMenuList, children: [
                {path: 'add', component: SysMenuAdd},
                {path: 'edit/:id', component: SysMenuEdit}
            ]
        },
        {path: '/sys/menu/index', redirect: '/sys/menu'},
        {
            path: '/sys/role', component: SysRoleList, children: [
                {path: 'add', component: SysRoleAdd},
                {path: 'edit/:id', component: SysRoleEdit},
                {path: 'permission/:id', component: SysRolePermission}
            ]
        },
        {path: '/sys/role/index', redirect: '/sys/role'},

        {path: '/sys/log', component: SysLoggList},
        {path: '/sys/log/index', redirect: '/sys/log'},

        {path: '/fls/activity', component: FlsActivityList},
        {path: '/fls/activity/index', redirect: '/fls/activity'},
    ]
})
